package delete3;

import java.net.DatagramPacket;
import java.net.DatagramSocket;


//服务器端
public class UDP22 {
    public static void main(String[] args) throws Exception {
        DatagramSocket socket=new DatagramSocket(7878);

        byte[] buffer=new byte[1024];
        DatagramPacket packet=new DatagramPacket(buffer,0,buffer.length);

        socket.receive(packet);

        System.out.println(new String(packet.getData(),0,packet.getData().length));
        socket.close();



    }
}
